<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="../inc/TagLibs.jsp"%>
<c:set var="pageTitle" value="项目类型" />
<%@ include file="../inc/Title.jsp"%>
<head>
<link rel="stylesheet" type="text/css" href="/css/base.css" />
<script src="/js/popup_ext.js"></script>
<script language="javascript">
	function doNew(){
		var url="/base/MakeTypeNew.ihtm?parent_id=${parentId}";
		ShowIframeNoScroll("项目类型",url,360,400,"refreshWin()");
	}
	function refreshWin(){
		window.location.reload(true);
	}
	function doEdit(id){
		var url="/base/MakeTypeEdit.ihtm?id="+id;
		ShowIframeNoScroll("项目类型",url,360,400,"refreshWin()");
	}
	function doDelete(id){
		ShowConfirm('确认框','确定删除吗？',340,80,"doDelAct("+id+")");
	}
	function doDelAct(id){
		if(popRetVal!=null){
			window.location="/base/MakeTypeDelete.ihtm?id="+id+"&from_url="+encodeURIComponent(window.location);
		}
	}
	function doCancel(){
		window.close();
	}
	function doSearch(){
		var parentId=document.getElementById("parent_id").value;
		window.location="/base/MakeTypeList.ihtm?parent_id="+parentId;
	}
	function doBack(){
		window.location="/base/MakeTypeList.ihtm?parent_id=${retId}";
	}
	function goChildren(parentId){
		window.location="/base/MakeTypeList.ihtm?parent_id="+parentId;
	}
	function doDownload(){
		window.location="/base/MakeTypeList.ihtm?content_type=EXCEL&parent_id=${parentId}";
	}
</script>
</head>
<body oncontextmenu="return false" scrol="yes" class="sheet" style="text-align:center;">
<div class="sheet-main" style="width:640px;text-align:left;margin:auto;">
  <div class="sheet-top">
    <div class="content">
      <h2>项目类型</h2>
      <p>根据制作工艺，定义业务的项目类型，例如灯箱、广告字、标识标牌、喷绘、展柜展架、门头店招、印刷、快展器材等等。</p>
    </div>
  </div>
  <div class="sheet-list">
    <div class="search-business">
	    <div class="add_content"> 	
	    	 <div align="right">
			 上级类别
			 <select name='parent_id' id="parent_id" style="width:140px">
				<option value="0" <c:if test="${parentId=='0'}">selected</c:if>>（无）</option>
				<commonTag:createSelectTree list="${makeTypeList}" emptyOption="0" defaultValue="${parentId}" />
			 </select>
			 <input type="button"  value=" 查 询" onClick="doSearch();"  class="buttom search-but">
			 <input type="button" class="buttom search-add" value=" 新 增" onClick="doNew();">
			 <input type="button" class="buttom search-back" value=" 回上级" onClick="doBack();" <c:if test="${parentId=='0'}">disabled="true"</c:if>>
			 <input type="button" class="buttom search-out" value=" 导 出" onClick="doDownload();" <c:if test="${currentUser.user.userType!=1 && fn:indexOf(currentUser.privs,';NO_EXPO;')!=-1}">disabled="true"</c:if>>
			 </div>
	     </div>
		 <%@include file="../inc/AlertMsg.jsp"%>
	     <div class="table-list">
	        <table width="100%">
	          	<tr>
					<th width="8%">序号</th>
					<th width="16%">名称</th>
					<th width="12%">成品单位</th>
					<th width="10%">类型</th>
					<th width="16%">工作中心</th>
					<th width="14%">自动扣库存</th>
					<th width="24%">操作</th>
				</tr>
				<c:forEach var="item" items="${list}">
				<tr>
					<td>${item.sequCode}</td>
					<td>${item.typeName}</td>
					<td>${item.unit}</td>
					<td>
						<c:if test="${item.type==2}"><font color="#ff0000">外协</font></c:if>
						<c:if test="${item.type==1}">自制</c:if>
					</td>
					<td><commonTag:showSimpleObjectName list="${workCenterList}" objectId="${item.workCenterId}" /></td>
					<td>
						<c:if test="${item.autoStoc=='Y'}">是</c:if>
						<c:if test="${item.autoStoc=='N'}">否</c:if>
					</td>
					<td>
						<a href="javascript:goChildren('${item.id}');">进入子分类</a>
						<a href="javascript:doEdit('${item.id}');">编辑</a>
						<a href="javascript:doDelete('${item.id}');">删除</a>
					</td>
				</tr>
				</c:forEach>
			</table>
	     </div>  
	   </div>  
  </div>
<div class="blank12"></blank>
</div>
</body>
</html>